﻿<!--#include file="../Include/Config.asp"-->
<link rel="stylesheet" href="../Css/Admin.css" type="text/css" />
<script language="javascript">
function CheckModifgPassword()
{ if (document.form1.Admin_pass.value.length < 6) {
		alert("密码过于简短,请输入6位以上密码!");
		document.form1.Admin_pass.focus();
        return 0;
		}
         if (document.form1.Admin_pass.value != document.form1.Admin_pass2.value) {
		alert("前后两次输入的密码不一致!");
		document.form1.Admin_pass.value="";
        document.form1.Admin_pass2.value="";
		document.form1.Admin_pass.focus();
        return 0;
		}
		return true;
}
</script>
<%
if request.Form.count>0 then
Admin_passold=md5(md5(trim(request.Form("Admin_pass_old")),32),16)
Admin_pass=md5(md5(trim(request.Form("Admin_pass")),32),16)
sql="select * from Admins where Admin_user='"&session("AdminId")&"' and Admin_pass='"&Admin_passold&"'"
rs.open sql,conn,1,3
if rs.eof then 
call ShowAlert("原始密码错误","")
else
rs("Admin_pass")=Admin_pass
rs.update
call ShowAlert("密码修改成功","AdminIndexMain.asp")
end if
rs.close
else
%>
<form action="" name="form1" method="post" onSubmit="return CheckModifgPassword();">
<table width="413" border="0" cellspacing="0" cellpadding="0" class="table">
  <tr>
    <th colspan="3" align="center">修改管理员密码</th>
  </tr>
  <tr>
    <td width="186" align="left">输入你的原始密码：</td>
    <td width="184" align="left"><input type="password" size="15" name="Admin_pass_old"></td>
    <td width="605" align="left">&nbsp;</td>
  </tr>
  <tr>
    <td align="left">输入您的新密码：</td>
    <td align="left"><input type="password" size="15" name="Admin_pass"></td>
    <td align="left">&nbsp;</td>
  </tr>
  <tr>
    <td align="left">再输一次新密码：</td>
    <td align="left"><input type="password" size="15" name="Admin_pass2"></td>
    <td align="left">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="center">
	  <div id="button"><input name="submit" type="submit" value="确定修改" />
      </div></td>
    <td align="left">&nbsp;</td>
  </tr>
</table>
</form>
<%
end if
%>

